<template>
  <PageBox :data="dataInfo" @searchBtn="getTbody">
    <template #search="{ search }">
      <ElFormItemBox label="工艺名称" prop="likeWords">
        <ElInputBox :data="search" dataName="likeWords" />
      </ElFormItemBox>
    </template>
    <template #headR>
      <SelectProductCrafts :data="dataInfo" @selectBtn="(arr: any) => {
        let _arr = arr.map((el: any) => ({
          craftCode: el.code,//工艺编码
          deviceCode: dataInfo.tabs.active,//	设备编码
        }))
        proxy.$api.ProductCraftDevice.AddProductCraftDevice(_arr)
          .then((res: any) => {
            getTbody()
          })
          .catch(() => {
            dataInfo.loading = false;
          });
      }" />
    </template>
  </PageBox>
</template>

<script setup lang="ts">
const { proxy } = getCurrentInstance() as any;
import './pageCss.scss'; // 引入样式
import { useListComponent } from './pageTs'; // 引入逻辑
const { dataInfo, getTbody } = useListComponent();
</script>
